/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Random;

/**
 * <p>Project: app2022 - Ball
 * <p>Powered by webrx On 2022-01-08 14:48:56
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ball {
    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            mm();
            System.out.println();
        }
    }

    public static void mm() {
        Random rand = new Random();
        //13014577033
        int[] nums = new int[6];

        int ss = 0;
        //红 1-33 6
        for (int i = 0; i < 6; i++) {
            int t = rand.nextInt(33) + 1;
            boolean f = false;
            for (int i1 = 0; i1 < nums.length; i1++) {
                ++ss;
                if (t == nums[i1]) {
                    f = true;
                    break;
                }
            }
            if (f) {
                --i;
                continue;
            } else {
                nums[i] = t;
            }
        }

        Arrays.sort(nums);

        System.out.println(Arrays.toString(nums));
        //蓝 1-16  1
        int blue = rand.nextInt(16) + 1;
        System.out.println(blue + "[总循环：" + ss + "次]");
    }
}
